package com.itheima.edu.info.manager.dao;


import com.itheima.edu.info.manager.domain.Manager;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class ManagerDao {
    private static ArrayList<Manager> list= new ArrayList<>();

    static {
        try {

            BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream("studentServer\\manager.txt"),"UTF-8"));
            String line;
            while ((line = br.readLine()) != null) {
                String[] splitLine = line.split(",");
                Manager stuTemp = new Manager(splitLine[0], splitLine[1], splitLine[2]);
                list.add(stuTemp);
            }
            br.close();

        } catch (Exception e) {
            e.printStackTrace();
        }

    }
   public ArrayList<Manager> findAllManager(){
        return list;
   }
}
